package day0306;

import java.io.File;
import java.io.IOException;

public class Test01 {
    public static void main(String[] args) {

        try {
            for (int i=1;i<=100;i++){
                File file = new File(i+".txt");
                if (file.exists()){
                    System.out.println("文件已存在");
                }else {
                    file.createNewFile();
                    System.out.println("创建成功");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
